// 封装购物车相关接口
import request from '@/utils/http'
// 获取-购物车列表
const getCartList = () => {
  return request({
    url: '/member/cart'
  })
}
// 加入-购物车
const insertCart = ({ skuId, count }) => {
  return request({
    url: '/member/cart',
    method: 'POST',
    data: {
      skuId,
      count
    }
  })
}

// 删除-购物车商品
const deleteCart = (ids) => {
  return request({
    url: '/member/cart',
    method: 'DELETE',
    data: {
      ids
    }
  })
}

// 合并购物车
const mergeCart = (data) => {
  return request({
    url: '/member/cart/merge',
    method: 'POST',
    data
  })
}



export { getCartList, insertCart, deleteCart, mergeCart }
